package br.senai.servlet;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import br.senai.dao.AlunoDAO;
import br.senai.entity.Aluno;
import br.senai.service.ProfessorService;

/**
 * Servlet implementation class ListaAlunoServlet
 */
@WebServlet("/ListaAluno")
public class ListaAlunoServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    public ListaAlunoServlet() {
        super();
    }


	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		AlunoDAO ad = new AlunoDAO();
		
		try {
			request.setAttribute("listarAluno", ad.getAlunos());
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		RequestDispatcher rd = request.getRequestDispatcher("listar_aluno.jsp");
        rd.forward(request, response);
		
		
		}
	

}
